package conversions

import (
	"HandWritingJVM/instructions/base"
	"HandWritingJVM/rtda"
)

//float -> *
type F2D struct {
	base.NoOperandsInstruction
}

func (self *F2D) Execute(frame *rtda.Frame) {
	stack := frame.OperandStack()
	f := stack.PopFloat()
	stack.PushDouble(float64(f))
}

type F2I struct {
	base.NoOperandsInstruction
}

func (self *F2I) Execute(frame *rtda.Frame) {
	stack := frame.OperandStack()
	f := stack.PopFloat()
	stack.PushInt(int32(f))
}

type F2L struct {
	base.NoOperandsInstruction
}

func (self *F2L) Execute(frame *rtda.Frame) {
	stack := frame.OperandStack()
	f := stack.PopFloat()
	stack.PushLong(int64(f))
}
